applescript: ask a user to input a several numbers in line

Hi there,

how can I ask in display dialog a several strings in one dialog window like this:


Input three letters in right column

window show me asks me to input

first letter [ ]

second letter [ ]

third letter [ ]

MacBook Pro, OS X El Capitan (10.11.2)

Posted on Aug 22, 2016 10:18 AM

Reply
1 reply

Aug 22, 2016 10:58 AM in response to sashaosonia

AppleScript's language implementation of display dialog does not offer multiple inputs, or formatting. However, you can separate your inputs with a delimiter, and then place those items into a list, from which you can reference those items.


Here is an demonstration AppleScript. You enter text (as an example) in this format: A1,B1,C1

use scripting additions set msg to "Input three letters for each of first letter, second letter, and third letter. Separate your responses by a comma (e.g. aaa,bbb,ccc)" set delimAnswer to text returned of (display dialog msg default answer "") set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ","} set dialogList to text items of delimAnswer set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return} display dialog "Items are: " & return & (items of dialogList) & return & "Item 1: " & (item 1 of dialogList) as text set AppleScript's text item delimiters to TID return

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

applescript: ask a user to input a several numbers in line

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.